/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * _Class.java
 *
 * Created on May 2, 2011, 11:46:28 PM
 */

package c0907m.group2.aitsm.gui;

import c0907m.group2.aitsm.core.db.ClassDb;
import c0907m.group2.aitsm.core.db.CourseDb;
import c0907m.group2.aitsm.core.db.CourseYearDb;
import c0907m.group2.aitsm.core.entity.ClassInfo;
import c0907m.group2.aitsm.core.entity.CourseInfo;
import c0907m.group2.aitsm.core.entity.CourseYearInfo;
import c0907m.group2.aitsm.core.report.ClassReporter;
import c0907m.group2.aitsm.gui.component.DefaultPanel;
import c0907m.group2.aitsm.gui.component.StatusBar;
import c0907m.group2.aitsm.gui.handler.TableCellListener;
import c0907m.group2.aitsm.util.Helper;
import c0907m.group2.aitsm.util.Settings;
import net.sf.jasperreports.engine.JRException;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import java.awt.event.ActionEvent;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * @author ISTC
 */
public class _Class extends DefaultPanel {
    public static final String DEFAULT_STATUS = "Add, update, delete classes";
    public final Logger logger = Logger.getLogger(_Class.class.getName());

    private List<ClassInfo> editingList;
    private List<CourseInfo> allCourses;
    private List<CourseYearInfo> allCourseYears;
    private List<Integer> courseIDs;
    private List<Integer> courseYearIDs;
    private ClassDb classDB;

    private JComboBox cboTableCourse;
    private JComboBox cboTableCourseYear;
    private DefaultTableModel dtm;
    private StatusBar statusBar;
    private DefaultCellEditor courseEditor;
    private DefaultCellEditor courseYearEditor;

    public void setStatusBar(StatusBar sb) {
        this.statusBar = sb;
    }

    /**
     * Creates new form User
     */
    public _Class() {
        initComponents();
        btnUpdate.setEnabled(false);
        statusBar = new StatusBar();
        cboTableCourse = new JComboBox();
        cboTableCourseYear = new JComboBox();
        classDB = new ClassDb();
        editingList = new ArrayList<ClassInfo>();
        dtm = (DefaultTableModel) tblClassList.getModel();
        loadDataToComboBox();
        loadDataToTable();
        tblClassListEventHandler();
    }

    /**
     * Reload all data from database
     */
    @Override
    public void refresh() {
        dtm.setRowCount(0);
        doReset();
        loadDataToTable();
    }

    /**
     * Update changes
     */
    @Override
    public void doUpdate() {
        if (editingList.size() == 0) {
            statusBar.setMessage("No changes have been made: Update cancelled.", StatusBar.WARNING_TYPE);
            return;
        }

        try {
            classDB.update(editingList);
            statusBar.setMessage("Update successful.", StatusBar.MESSAGE_TYPE);
        } catch (SQLException e) {
            logger.log(Level.WARNING, "Update failed: " + e.getMessage());
            statusBar.setMessage("Update failed.", StatusBar.ERROR_TYPE);
            refresh();
        }

        editingList.removeAll(editingList);
    }

    /**
     * Add new Subject to database
     */
    @Override
    public void doAdd() {
        if (txtName.getText().trim().equals("")) {

            new JOptionPane().showMessageDialog(
                    this,
                    "Name is required",
                    "Message",
                    JOptionPane.ERROR_MESSAGE
            );
            return;

        }
        if (cboCourse.getSelectedIndex() == 0
                || cboCourseYear.getSelectedIndex() == 0) {
            new JOptionPane().showMessageDialog(
                    this,
                    "Please select course and course year",
                    "Message",
                    JOptionPane.ERROR_MESSAGE
            );
            return;

        }
        ClassInfo newClass = new ClassInfo();
        newClass.setName(txtName.getText().trim());
        newClass.setCourseId(allCourses.
                get(cboCourse.getSelectedIndex() - 1)
                .getId());
        newClass.setCourseYearId(allCourseYears.
                get(cboCourseYear.getSelectedIndex() - 1)
                .getId());
        newClass.setDescription(txaDescription.getText());
        newClass.setActive(true);

        try {
            classDB.insert(newClass);
            statusBar.setMessage("Subject added", StatusBar.MESSAGE_TYPE);
            refresh();
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, ex.getMessage());
            statusBar.setMessage("Adding failed.", StatusBar.ERROR_TYPE);
        }
    }

    /**
     * Reset all fields to blank
     */
    @Override
    public void doReset() {
        txtName.setText("");
        txaDescription.setText("");
        txtSearchByName.setText("");
    }

    /**
     * Search classes by name
     */
    public void nameSearch() {
        dtm.setRowCount(0);
        List<ClassInfo> result = null;

        String name = txtSearchByName.getText();
        try {
            result = classDB.select(name);

            if (!result.isEmpty()) {
                addDataToTable(result);
                statusBar.setMessage(result.size() + " match(es) found!",
                        StatusBar.MESSAGE_TYPE);
            } else {
                statusBar.setMessage("No match found!",
                        StatusBar.MESSAGE_TYPE);
            }
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, null, ex.getSQLState());
            statusBar.setMessage("Unable to load data", StatusBar.ERROR_TYPE);
        }
    }

    /**
     * Advance search for classes
     */
    private void advanceSearch() {
        dtm.setRowCount(0);
        List<ClassInfo> result = null;

        String name = txtNameDialog.getText();
        int courseId = 0;
        try {
            courseId = new CourseDb().select()
                    .get(cboCourseDialog.getSelectedIndex())
                    .getId();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        int courseYearId = allCourseYears
                .get(cboCourseYearDialog.getSelectedIndex())
                .getId();


        try {
            result = classDB.select(name, courseId, courseYearId);
            if (!result.isEmpty()) {
                addDataToTable(result);
                statusBar.setMessage(result.size() + " match(es) found!",
                        StatusBar.MESSAGE_TYPE);
            } else {
                statusBar.setMessage("No match found!",
                        StatusBar.MESSAGE_TYPE);
            }
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, null, ex.getSQLState());
            statusBar.setMessage("Unable to load data", StatusBar.ERROR_TYPE);
        }
        dlgSearch.dispose();
    }


    /**
     * Add data from a list of classes into table
     *
     * @param result list to add
     */
    private void addDataToTable(List<ClassInfo> result) {
        CourseDb cd = new CourseDb();
        CourseYearDb cyd = new CourseYearDb();
        courseIDs = new ArrayList<Integer>();
        courseYearIDs = new ArrayList<Integer>();

        try {
            for (ClassInfo r : result) {
                String course = cd.select(r.getCourseId()).getName();
                String courseYear = cyd.
                        select(r.getCourseYearId()).getStartYear()
                        + " - " + cyd.
                        select(r.getCourseYearId()).getEndYear();

                cboTableCourse = (JComboBox) courseEditor.getComponent();
                cboTableCourse.setSelectedItem(course);
                cboTableCourseYear = (JComboBox) courseYearEditor.getComponent();
                cboTableCourseYear.setSelectedItem(courseYear);

                dtm.addRow(new Object[]{
                        r.getId(),
                        r.getName(),
                        course,
                        courseYear,
                        r.getDescription(),
                        r.isActive()
                });
                courseIDs.add(r.getCourseId());
                courseYearIDs.add(r.getCourseYearId());
            }

        } catch (SQLException ex) {
            logger.log(Level.SEVERE, null, ex.getSQLState());
            statusBar.setMessage("Unable to load data", StatusBar.ERROR_TYPE);
        }
    }

    /**
     * Load all Classes from database to table when initialize
     */
    private void loadDataToTable() {
        classDB = new ClassDb();
        List<ClassInfo> classList = null;
        courseEditor = Helper.addComboBoxToTable(tblClassList, cboTableCourse, 2);
        courseYearEditor = Helper.addComboBoxToTable(tblClassList, cboTableCourseYear, 3);

        //load data from database
        try {
            classList = classDB.select();
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, ex.getMessage());
            statusBar.setMessage("Unable to load data.", StatusBar.WARNING_TYPE);
        }

        addDataToTable(classList);
    }

    /**
     * Handle events for table tblClassList
     */
    private void tblClassListEventHandler() {
        tblClassListCellHandler();
        tblClassListRowSorter();
    }

    /**
     * Get a table row where it's cell is edited and
     * add row to a list for updating to database
     */
    public void tblClassListCellHandler() {
        Action action = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                btnUpdate.setEnabled(true);
                TableCellListener tcl = (TableCellListener) e.getSource();

                int row = tcl.getRow();
                int column = tcl.getColumn();

                ClassInfo classToUpdate = new ClassInfo();
                cboTableCourse = (JComboBox) courseEditor.getComponent();
                cboTableCourseYear = (JComboBox) courseYearEditor.getComponent();

                try {
                    if (column == 2) {
                        classToUpdate.setId((Integer) dtm.getValueAt(row, 0));
                        classToUpdate.setName((String) dtm.getValueAt(row, 1));
                        classToUpdate.setCourseId(allCourses
                                .get(cboTableCourse
                                        .getSelectedIndex())
                                .getId());
                        classToUpdate.setCourseYearId(courseYearIDs.get(row));
                        classToUpdate.setDescription((String) dtm.getValueAt(row, 4));
                        classToUpdate.setActive((Boolean) dtm.getValueAt(row, 5));

                        courseIDs.set(row, allCourses
                                .get(cboTableCourse
                                        .getSelectedIndex())
                                .getId());
                    } else if (column == 3) {
                        classToUpdate.setId((Integer) dtm.getValueAt(row, 0));
                        classToUpdate.setName((String) dtm.getValueAt(row, 1));
                        classToUpdate.setCourseYearId(allCourseYears
                                .get(cboTableCourseYear
                                        .getSelectedIndex())
                                .getId());
                        classToUpdate.setCourseId(courseIDs.get(row));
                        classToUpdate.setDescription((String) dtm.getValueAt(row, 4));
                        classToUpdate.setActive((Boolean) dtm.getValueAt(row, 5));

                        courseYearIDs.set(row, allCourseYears
                                .get(cboTableCourseYear
                                        .getSelectedIndex())
                                .getId());
                    } else {
                        classToUpdate.setId((Integer) dtm.getValueAt(row, 0));
                        classToUpdate.setName((String) dtm.getValueAt(row, 1));
                        classToUpdate.setCourseYearId(courseYearIDs.get(row));
                        classToUpdate.setCourseId(courseIDs.get(row));
                        classToUpdate.setDescription((String) dtm.getValueAt(row, 4));
                        classToUpdate.setActive((Boolean) dtm.getValueAt(row, 5));
                    }
                    editingList.add(classToUpdate);
                } catch (NumberFormatException e1) {
                    new JOptionPane().showMessageDialog(
                            null,
                            "Wrong format!",
                            "Warning",
                            JOptionPane.ERROR_MESSAGE
                    );
                    dtm.setValueAt(tcl.getOldValue(), row, column);
                } catch (Exception e2) {
                    logger.log(Level.SEVERE, e2.getMessage());
                    statusBar.setMessage("Unknown", StatusBar.ERROR_TYPE);
                }

                //System.out.println("Event fired!");
            }
        };

        TableCellListener tcl = new TableCellListener(tblClassList, action);
    }

    /**
     * Sort rows when click a table header
     */
    public void tblClassListRowSorter() {
        RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(dtm);
        tblClassList.setRowSorter(sorter);
    }

    /**
     * Load all data to all combobox that is used in this form
     */
    private void loadDataToComboBox() {
        try {
            allCourses = new CourseDb().select();
            allCourseYears = new CourseYearDb().select();
            List<CourseInfo> activeCourse = new ArrayList<CourseInfo>();
            List<CourseYearInfo> activeCourseYear = new ArrayList<CourseYearInfo>();
            for (CourseInfo ci : allCourses) {
                cboCourseDialog.addItem(ci.getName());
                if (ci.isActive()) {
                    cboTableCourse.addItem(ci.getName());
                    cboCourse.addItem(ci.getName());
                    cboCourseReport.addItem(ci.getName());
                    activeCourse.add(ci);
                }
            }
            allCourses = activeCourse;

            for (CourseYearInfo cyi : allCourseYears) {
                cboTableCourseYear.addItem(cyi.getStartYear() + " - " + cyi.getEndYear());
                cboCourseYearDialog.addItem(cyi.getStartYear() + " - " + cyi.getEndYear());
                cboCourseYear.addItem(cyi.getStartYear() + " - " + cyi.getEndYear());
                cboCourseYearReport.addItem(cyi.getStartYear() + " - " + cyi.getEndYear());
            }
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, ex.getSQLState());
            statusBar.setMessage("Unable to load data.", StatusBar.ERROR_TYPE);
        }
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dlgSearch = new javax.swing.JDialog();
        pnDialog = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtNameDialog = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        cboCourseDialog = new javax.swing.JComboBox();
        cboCourseYearDialog = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        btnSearchDialog = new javax.swing.JButton();
        btnCancelDialog = new javax.swing.JButton();
        dlgReport = new javax.swing.JDialog();
        pnReport = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        cboCourseReport = new javax.swing.JComboBox();
        cboCourseYearReport = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        btnViewReport = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        pnClassInfo = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txaDescription = new javax.swing.JTextArea();
        txtName = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        cboCourse = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        cboCourseYear = new javax.swing.JComboBox();
        btnAdd = new javax.swing.JButton();
        btnUpdate = new javax.swing.JButton();
        btnReport = new javax.swing.JButton();
        pnClassList = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblClassList = new javax.swing.JTable();
        jLabel4 = new javax.swing.JLabel();
        btnRefresh = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        txtSearchByName = new javax.swing.JTextField();
        btnSearchByName = new javax.swing.JButton();
        lblAdvSearch = new javax.swing.JLabel();

        dlgSearch.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        dlgSearch.setTitle("Advance search");
        dlgSearch.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

        pnDialog.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setText("Name:");

        jLabel6.setText("Course:");

        jLabel7.setText("Course year:");

        btnSearchDialog.setText("Search");
        btnSearchDialog.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchDialogActionPerformed(evt);
            }
        });

        btnCancelDialog.setText("Cancel");
        btnCancelDialog.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelDialogActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnDialogLayout = new javax.swing.GroupLayout(pnDialog);
        pnDialog.setLayout(pnDialogLayout);
        pnDialogLayout.setHorizontalGroup(
                pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnDialogLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(pnDialogLayout.createSequentialGroup()
                                                .addComponent(btnSearchDialog)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnCancelDialog))
                                        .addComponent(txtNameDialog, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                .addComponent(cboCourseDialog, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(cboCourseYearDialog, javax.swing.GroupLayout.Alignment.LEADING, 0, 99, Short.MAX_VALUE)))
                                .addContainerGap(57, Short.MAX_VALUE))
        );
        pnDialogLayout.setVerticalGroup(
                pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnDialogLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel1)
                                        .addComponent(txtNameDialog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel6)
                                        .addComponent(cboCourseDialog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel7)
                                        .addComponent(cboCourseYearDialog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pnDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(btnSearchDialog)
                                        .addComponent(btnCancelDialog))
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgSearchLayout = new javax.swing.GroupLayout(dlgSearch.getContentPane());
        dlgSearch.getContentPane().setLayout(dlgSearchLayout);
        dlgSearchLayout.setHorizontalGroup(
                dlgSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnDialog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        dlgSearchLayout.setVerticalGroup(
                dlgSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnDialog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pnReport.setBackground(new java.awt.Color(255, 255, 255));

        jLabel11.setText("Course:");

        cboCourseReport.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"All"}));

        cboCourseYearReport.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"All"}));

        jLabel12.setText("Course year:");

        btnViewReport.setText("View report");
        btnViewReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnViewReportActionPerformed(evt);
            }
        });

        jLabel10.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabel10.setText("Select from options below and click View Report to get reporting list of classes:");

        javax.swing.GroupLayout pnReportLayout = new javax.swing.GroupLayout(pnReport);
        pnReport.setLayout(pnReportLayout);
        pnReportLayout.setHorizontalGroup(
                pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnReportLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(pnReportLayout.createSequentialGroup()
                                                .addGroup(pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                        .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addGroup(pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                        .addComponent(cboCourseReport, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addComponent(cboCourseYearReport, javax.swing.GroupLayout.Alignment.LEADING, 0, 99, Short.MAX_VALUE)
                                                        .addComponent(btnViewReport)))
                                        .addComponent(jLabel10))
                                .addContainerGap(11, Short.MAX_VALUE))
        );
        pnReportLayout.setVerticalGroup(
                pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnReportLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel10)
                                .addGap(24, 24, 24)
                                .addGroup(pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel11)
                                        .addComponent(cboCourseReport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pnReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel12)
                                        .addComponent(cboCourseYearReport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addComponent(btnViewReport)
                                .addContainerGap(51, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgReportLayout = new javax.swing.GroupLayout(dlgReport.getContentPane());
        dlgReport.getContentPane().setLayout(dlgReportLayout);
        dlgReportLayout.setHorizontalGroup(
                dlgReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnReport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        dlgReportLayout.setVerticalGroup(
                dlgReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnReport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        setBackground(new java.awt.Color(255, 255, 255));

        pnClassInfo.setBackground(new java.awt.Color(255, 255, 255));
        pnClassInfo.setBorder(javax.swing.BorderFactory.createTitledBorder("Add new class"));
        pnClassInfo.setPreferredSize(new java.awt.Dimension(452, 219));

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel2.setText("Name:");
        jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jLabel3.setText("Description:");

        txaDescription.setColumns(20);
        txaDescription.setRows(5);
        jScrollPane1.setViewportView(txaDescription);

        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel8.setText("Course:");

        cboCourse.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"Select"}));

        jLabel9.setText("Course year:");

        cboCourseYear.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"Select"}));

        javax.swing.GroupLayout pnClassInfoLayout = new javax.swing.GroupLayout(pnClassInfo);
        pnClassInfo.setLayout(pnClassInfoLayout);
        pnClassInfoLayout.setHorizontalGroup(
                pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnClassInfoLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel2)
                                        .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(pnClassInfoLayout.createSequentialGroup()
                                                .addComponent(txtName, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                                                .addGap(184, 184, 184))
                                        .addGroup(pnClassInfoLayout.createSequentialGroup()
                                                .addGroup(pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnClassInfoLayout.createSequentialGroup()
                                                                .addComponent(cboCourse, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jLabel9)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(cboCourseYear, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                .addContainerGap(80, Short.MAX_VALUE))))
        );
        pnClassInfoLayout.setVerticalGroup(
                pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnClassInfoLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel2))
                                .addGap(18, 18, 18)
                                .addGroup(pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel8)
                                        .addComponent(cboCourse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel9)
                                        .addComponent(cboCourseYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
                                .addGroup(pnClassInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel3)
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(28, 28, 28))
        );

        btnAdd.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/add-16.png"));
        btnAdd.setText("Add");
        btnAdd.setMaximumSize(new java.awt.Dimension(61, 23));
        btnAdd.setMinimumSize(new java.awt.Dimension(61, 23));
        btnAdd.setPreferredSize(new java.awt.Dimension(61, 23));
        btnAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddActionPerformed(evt);
            }
        });

        btnUpdate.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/update-16.png"));
        btnUpdate.setText("Update");
        btnUpdate.setMaximumSize(new java.awt.Dimension(71, 23));
        btnUpdate.setMinimumSize(new java.awt.Dimension(71, 23));
        btnUpdate.setPreferredSize(new java.awt.Dimension(71, 23));
        btnUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUpdateActionPerformed(evt);
            }
        });

        btnReport.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/printer-16.png"));
        btnReport.setText("Report");
        btnReport.setMaximumSize(new java.awt.Dimension(71, 23));
        btnReport.setMinimumSize(new java.awt.Dimension(71, 23));
        btnReport.setPreferredSize(new java.awt.Dimension(71, 23));
        btnReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReportActionPerformed(evt);
            }
        });

        pnClassList.setBackground(new java.awt.Color(255, 255, 255));
        pnClassList.setBorder(javax.swing.BorderFactory.createTitledBorder("Class list"));

        tblClassList.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][]{

                },
                new String[]{
                        "ID", "Name", "Course", "Course year", "Description", "Active"
                }
        ) {
            Class[] types = new Class[]{
                    java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean[]{
                    false, true, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit[columnIndex];
            }
        });
        tblClassList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblClassListMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tblClassList);
        tblClassList.getColumnModel().getColumn(0).setPreferredWidth(30);
        tblClassList.getColumnModel().getColumn(1).setPreferredWidth(50);
        tblClassList.getColumnModel().getColumn(5).setResizable(false);
        tblClassList.getColumnModel().getColumn(5).setPreferredWidth(30);

        javax.swing.GroupLayout pnClassListLayout = new javax.swing.GroupLayout(pnClassList);
        pnClassList.setLayout(pnClassListLayout);
        pnClassListLayout.setHorizontalGroup(
                pnClassListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnClassListLayout.createSequentialGroup()
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
        );
        pnClassListLayout.setVerticalGroup(
                pnClassListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnClassListLayout.createSequentialGroup()
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
                                .addContainerGap())
        );

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 16));
        jLabel4.setForeground(new java.awt.Color(0, 102, 255));
        jLabel4.setText("MANAGE CLASSES");

        btnRefresh.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/refresh-16.gif"));
        btnRefresh.setText("Refresh");
        btnRefresh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRefreshActionPerformed(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Search for class"));
        jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanel1.setMaximumSize(new java.awt.Dimension(452, 219));
        jPanel1.setMinimumSize(new java.awt.Dimension(452, 219));

        jLabel5.setText("Search by name:");

        btnSearchByName.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/search-16.png"));
        btnSearchByName.setText("Search");
        btnSearchByName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchByNameActionPerformed(evt);
            }
        });

        lblAdvSearch.setForeground(new java.awt.Color(0, 51, 255));
        lblAdvSearch.setText("Advance search");
        lblAdvSearch.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lblAdvSearch.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblAdvSearchMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(txtSearchByName, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnSearchByName))
                                        .addComponent(jLabel5)
                                        .addComponent(lblAdvSearch))
                                .addContainerGap(130, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addContainerGap(43, Short.MAX_VALUE)
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txtSearchByName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(btnSearchByName, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addComponent(lblAdvSearch)
                                .addGap(46, 46, 46))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jLabel4)
                                                        .addGroup(layout.createSequentialGroup()
                                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addComponent(pnClassInfo, javax.swing.GroupLayout.DEFAULT_SIZE, 458, Short.MAX_VALUE)
                                                                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(pnClassList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                        .addGroup(layout.createSequentialGroup()
                                                .addGap(266, 266, 266)
                                                .addComponent(btnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnRefresh, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnReport, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addContainerGap(44, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                                .addGap(23, 23, 23)
                                .addComponent(jLabel4)
                                .addGap(29, 29, 29)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addGroup(layout.createSequentialGroup()
                                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(pnClassInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(pnClassList, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(btnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(btnUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(btnRefresh, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(btnReport, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(119, 119, 119))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnAddActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnAddActionPerformed
        doAdd();
    }//GEN-LAST:event_btnAddActionPerformed

    private void btnUpdateActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed
        doUpdate();
    }//GEN-LAST:event_btnUpdateActionPerformed

    private void btnReportActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnReportActionPerformed
        dlgReport = new JDialog();
        dlgReport.setContentPane(pnReport);
        dlgReport.setLocationRelativeTo(null);
        dlgReport.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
        dlgReport.pack();
        dlgReport.setVisible(true);
    }//GEN-LAST:event_btnReportActionPerformed

    private void tblClassListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblClassListMouseClicked
        btnUpdate.setEnabled(true);
    }//GEN-LAST:event_tblClassListMouseClicked

    private void btnRefreshActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnRefreshActionPerformed
        refresh();
    }//GEN-LAST:event_btnRefreshActionPerformed

    private void btnSearchByNameActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnSearchByNameActionPerformed
        nameSearch();
    }//GEN-LAST:event_btnSearchByNameActionPerformed

    private void lblAdvSearchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblAdvSearchMouseClicked
        dlgSearch = new JDialog();
        dlgSearch.setContentPane(pnDialog);
        dlgSearch.setLocationRelativeTo(null);
        dlgSearch.pack();
        dlgSearch.setVisible(true);
    }//GEN-LAST:event_lblAdvSearchMouseClicked

    private void btnSearchDialogActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnSearchDialogActionPerformed
        advanceSearch();
    }//GEN-LAST:event_btnSearchDialogActionPerformed

    private void btnCancelDialogActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnCancelDialogActionPerformed
        dlgSearch.dispose();
    }//GEN-LAST:event_btnCancelDialogActionPerformed

    private void btnViewReportActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnViewReportActionPerformed
        ClassReporter cr = new ClassReporter();
        if (cboCourseReport.getSelectedIndex() != 0) {
            cr.hasCourseId(allCourses.get(cboCourseReport.getSelectedIndex() - 1).getId());
        }
        if (cboCourseYearReport.getSelectedIndex() != 0) {
            cr.hasCourseYearId(allCourseYears.get(cboCourseYearReport.getSelectedIndex() - 1).getId());
        }
        try {
            cr.view();
        } catch (JRException ex) {
            logger.log(Level.SEVERE, null, ex);
            statusBar.setMessage("Unable to view report.", StatusBar.ERROR_TYPE);
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, null, ex);
            statusBar.setMessage("Unable to connect to server.", StatusBar.ERROR_TYPE);
        }
        dlgReport.dispose();
    }//GEN-LAST:event_btnViewReportActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAdd;
    private javax.swing.JButton btnCancelDialog;
    private javax.swing.JButton btnRefresh;
    private javax.swing.JButton btnReport;
    private javax.swing.JButton btnSearchByName;
    private javax.swing.JButton btnSearchDialog;
    private javax.swing.JButton btnUpdate;
    private javax.swing.JButton btnViewReport;
    private javax.swing.JComboBox cboCourse;
    private javax.swing.JComboBox cboCourseDialog;
    private javax.swing.JComboBox cboCourseReport;
    private javax.swing.JComboBox cboCourseYear;
    private javax.swing.JComboBox cboCourseYearDialog;
    private javax.swing.JComboBox cboCourseYearReport;
    private javax.swing.JDialog dlgReport;
    private javax.swing.JDialog dlgSearch;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblAdvSearch;
    private javax.swing.JPanel pnClassInfo;
    private javax.swing.JPanel pnClassList;
    private javax.swing.JPanel pnDialog;
    private javax.swing.JPanel pnReport;
    private javax.swing.JTable tblClassList;
    private javax.swing.JTextArea txaDescription;
    private javax.swing.JTextField txtName;
    private javax.swing.JTextField txtNameDialog;
    private javax.swing.JTextField txtSearchByName;
    // End of variables declaration//GEN-END:variables

}

